package com.ptszyxx.popose.common.enums;

import com.ysg.utils.YStringUtil;

public enum HomeTabEnum {
    city(0, "同城"),
    near(1, "活跃"),
    online(2, "在线"),
    account(3, "切换账号"),
    other(3, "其他");

    private int type;
    private String name;

    HomeTabEnum(int type, String name){
        this.type = type;
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static HomeTabEnum get(String name){
        HomeTabEnum[] values = values();
        for (HomeTabEnum item: values) {
            if (YStringUtil.eq(item.getName(), name)){
                return item;
            }
        }
        return null;
    }

    public static HomeTabEnum getTab(int tab){
        HomeTabEnum[] values = values();
        for (HomeTabEnum item: values) {
            if (YStringUtil.eq(item.getType(), tab)){
                return item;
            }
        }
        return null;
    }

}
